In real life, the plane outline of an object can generally be represented by a combination of straight lines or arcs. The Hough transformation is one of the basic methods for recognizing geometries from images. The basic idea of the Hough transformation is to convert the curve of an original space into a point of a parameter space through the curve expression by utilizing the duality of the point and the line, vote within the range of the independent variable in the parameter space through the foreground pixel, and set a threshold for the voting value. If a vote amount in a certain area is greater than the threshold, the area correspondingly has a straight line, and the voting peak is to be found in the area to determine the parameter in the curve expression, thereby determining the curve equation in the original space. As shown in FIG. 1, a straight line ρ=x cos θ+y sin θ in a black and white image is determined, where ρ denotes a distance from the origin of the image to the straight line, and θ denotes an angle between the straight line and the horizontal axis. In the original space field, as long as the parameters θ and ρ are determined, the straight line in the range of the given independent variable x is determined. As shown in FIG. 2, if the range of a point (xi,yi) and the parameter θ are determined, one ρ is determined whenever one θ is given, which corresponds to a set of straight lines passing through the point (xi,yi) in the original space; if two points (xi,yi) and (xi,yj) are given, the intersection point (θ′,ρ′) of two sinusoidal curves ρ=xi cos θ+yi sin θ and ρ=xj cos θ+yj sin θ are the straight line parameters passing through the two points. As shown in FIG. 3, when θ is taken from the minimum value θmin to the maximum value θmax successively, the corresponding ρ in each area is accumulated. If each point on the straight line in the original space is voted in the corresponding parameter space, there must be a peak of the largest amount of accumulated votes in a plurality of regions in the parameter space, and the parameter corresponded by the peak is the corresponding parameter of the straight line to be found.
In order to filter out the short straight lines which has fewer foreground pixels and fewer votes, it needs to lower the filter threshold, but lowering the filter thresholds will also lead to more straight lines near the long straight lines being filtered out. As shown in FIG. 5, the voting weight which is not much different from the voting peak is increased significantly. If all these votes are taken as the straight line parameters, there must be more straight lines to be extracted in the corresponding original space, and the effect of finding the ideal straight lines accurately cannot be achieved. Therefore, there are contradictions in the straight line detection accuracy and the coverage scope in the Hough transformation method in the prior art: if the voting filter threshold is large, the short straight lines will not be detected; if the voting filter threshold is small, the detection accuracy of the long straight lines will be lower.